const Base = require('../../base.js');
const qr = require('qr-image')

module.exports = class extends Base {
  async indexAction() {
    let code = this.get('code')
    let url = 'http://' + this.ctx.host + '/#/pages/about/register?code=' + code
    console.log(url)  
    let img = qr.image(url,{
      ec_level: 'Q',
      size: 10,
      margin: 1,
      parse_url: true
    })
    this.type = 'image/png'
    this.body = img
  }
};
